﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="Home.aspx.cs" Inherits="NoteSystem.Home" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .auto-style1 {
            height: 26px;
            width: 226px;
        }

        .auto-style2 {
            width: 226px;
        }

        .auto-style3 {
            height: 26px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="box_right col-xs-9 ">
        <!--主页列表-->
        <%=InitUser() %>
        <!--文章列表-->
        <div class="segment3">
            <div class="table-responsive" style="padding: 0 10px;">
                <table class="table">
                    <thead>
                        <tr>
                            <th>
                                <input class="checkbox" type="checkbox" name="subBox"></th>
                            <th>作者</th>
                            <th>日志标题</th>
                            <th>查看次数</th>
                            <th class="auto-style2">创建时间</th>
                            <th>操作</th>
                        </tr>
                    </thead>

                    <tbody>
                        <asp:Repeater ID="rptNote" runat="server" OnItemCommand="rptNote_ItemCommand" OnItemDataBound="rptNote_ItemDataBound">
                            <ItemTemplate>
                                <tr class="mylist">
                                    <td>
                                        <asp:CheckBox CssClass="cbxItem" ID="cbxItem" runat="server" /></td>

                                    <td><%#Eval("account") %></td>
                                    <td><%#Eval("title") %></td>
                                    <td><%#Eval("read_count") %></td>
                                    <td><%#Eval("create_time") %></td>
                                    <td><a href='show.aspx?id=<%#Eval("id") %>'>查看</a>
                                        <asp:LinkButton ID="LinkButton1" CommandArgument='<%#Eval("id") %>' runat="server">删除</asp:LinkButton>
                                    </td>
                                    <asp:HiddenField ID="hfUserId" runat="server" Value='<%#Eval("user_id") %>' />
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </tbody>
                </table>
                <div class="clear"></div>
                <div class="case_page">
                    <div class="page_left">
                        <input type="button" value="全选" onclick="checkAll()" />
                        <input type="button" value="全不选" onclick="checkAllNot()" />
                        <input type="button" value="反选" onclick="checkResver()" />
                        <span class="glyphicon glyphicon-trash"></span><a href="#" id="delete">&nbsp;删除</a>
                        <asp:LinkButton ID="LinkButton2" runat="server">LinkButton</asp:LinkButton>
                    </div>
                    <div class="page_right">
                        <ul class="pagination">
                            <li><a href="#">«</a></li>
                            <li class="active"><a href="#">1</a></li>
                            <li><a href="#">2</a></li>
                            <li><a href="#">3</a></li>
                            <li><a href="#">4</a></li>
                            <li><a href="#">5</a></li>
                            <li><a href="#">»</a></li>
                        </ul>
                    </div>
                </div>

            </div>
        </div>

        <script type="text/javascript">
            //javascript
            function checkAll() {
                var list = document.getElementsByClassName("cbxItem")
                for (var item of list) {
                    item.children[0].checked = true;
                }

            }
            function checkAllNot() {
                var list = document.getElementsByClassName("cbxItem")
                for (var item of list) {
                    item.children[0].checked = false;
                }

            }
            function checkResver() {
                var list = document.getElementsByClassName("cbxItem")
                for (var item of list) {
                    item.children[0].checked = !item.children[0].checked;
                }

            }
        </script>

    </div>
</asp:Content>
